﻿<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="TopicGroup.aspx.cs" Inherits="Topics_TopicGroup" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <asp:Panel ID="pnlDirectrions" CssClass="DirectionText" Visible='<%#CurrentGroup != null && !string.IsNullOrEmpty(CurrentGroup.Notes)%>' runat="server">
        <p>
            <%#CurrentGroup != null ? CurrentGroup.Notes : "" %>
        </p>
    </asp:Panel>
    <div class="actionButtons clearfix">
        <div class="floatRight">
            <acms:ActionButton ID="btnAdd" Text="Add New Topic" Icon="Add" runat="server" />
        </div>
    </div>
    <telerik:RadGrid ID="gridTopics" SkinID="InlineEdit" runat="server" AllowAutomaticDeletes="True" 
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
        AutoGenerateColumns="False" DataSourceID="dsTopics" GridLines="None" 
        onitemcommand="gridTopics_ItemCommand">
        <MasterTableView InsertItemDisplay="Bottom" DataSourceID="dsTopics"
            DataKeyNames="Id,ConcurencyId">
            <Columns>
                <acms:RadGridTextBoxColumn DataField="Name" HeaderText="Name" SortExpression="Name" Required="true" />
                <telerik:GridBoundColumn DataField="Created" HeaderText="Created" ReadOnly="true" />
                <acms:RadGridSequenceColumn HeaderText="Sequence" SortExpression="Sequence" SequenceField="Sequence" ShowSequence="false" />
                <acms:RadGridHyperLinkColumn DataTextField="FileCount" DataNavigateUrlFormatString="TopicFiles.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id,TopicGroupId" HeaderText="Files" SortExpression="FileCount"/>
                <acms:RadGridHyperLinkColumn Text="View Posts" DataNavigateUrlFormatString="TopicPosts.aspx?Id={0}&GroupId={1}" DataNavigateUrlFields="Id, TopicGroupId" HeaderText="Posts"/>
                <acms:RadGridEditColumn/>
                <acms:RadGridDeleteColumn/>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <acms:TopicGroupDataSource ID="dsTopicGroup" runat="server" 
        onselectdata="dsTopicGroup_SelectData" />
    <acms:TopicDataSource ID="dsTopics" runat="server" 
        onselectdata="dsTopics_SelectData" onupdatingdata="dsTopics_UpdatingData" 
        />
    <telerik:RadAjaxLoadingPanel ID="loading" InitialDelayTime="0" MinDisplayTime="2" Transparency="50" BackColor="DimGray" runat="server" Height="100%"
        Width="100%">
        <img alt="Loading..." src="../icons/loading1.gif" style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager DefaultLoadingPanelID="loading" EnableAJAX="true" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridTopics">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridTopics" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnAdd">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridTopics" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
</asp:Content>

